package com.david.dubbo.annotation;

import com.david.dubbo.annotation.service.DavidServiceComponet;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * @author David
 * @version V1.0
 * @Package com.david.dubbo.xml
 * @date 2021/4/11 10:02
 */
public class DavidConsumerApplication {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConsumerConfiguration.class);
        context.start();
        DavidServiceComponet service = context.getBean(DavidServiceComponet.class);
        service.queryUserById(5);
    }
    @Configuration
    @PropertySource("classpath:/dubbo-consumer.properties")
    @EnableDubbo
    @ComponentScan(basePackages = "com.david.dubbo.annotation.service")
    static class ConsumerConfiguration{

    }
}
